﻿using YNTK.Common.Helper;
using YNTK.Common.Model;
using YNTK.SubDev.Entitys.Dto.ZyOaProduct;
using Mapster;
using System.Collections.Generic;

namespace YNTK.SubDev.Entitys.Mapper.ZyOaProduct
{
	public class Mapper : IRegister
	{
		public void Register(TypeAdapterConfig config)
		{
			config.ForType<ZyOaProductCrInput, ZyOaProductEntity>()
				.Map(dest => dest.Photos, src => src.photos.ToJson())
				;
			config.ForType<ZyOaProductEntity, ZyOaProductInfoOutput>()
				.Map(dest => dest.photos, src => src.Photos.ToObject<List<FileControlsModel>>())
				;
		}
	}
}